package com.yigo.bsc.api.constant;

import com.yigo.framework.http.ErrorCode;
import com.yigo.framework.util.I18nUtil;
import lombok.AllArgsConstructor;

import java.util.*;

/**
 * @author chenzl
 */
@AllArgsConstructor
public enum BscCodeEnum implements ErrorCode {
    /**
     * 字典类型已存在：编码[{0}]名称[{1}]
     */
    DICT_TYPE_EXISTS("BSC-100001"),
    /**
     * 字典选项已存在：类型编码[{0}]选项编码[{1}]选项名称[{2}]
     */
    DICT_ITEM_EXISTS("BSC-100002");

    private String code;

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMsg(Object... args) {
        return I18nUtil.getMsg(Locale.getDefault(), "i18n/bsc_msg", code, args);
    }
}
